#!/usr/bin/env python
# -*- coding: utf-8 -*-

import urllib2
import datetime

def get_host(domain):
    if domain.startswith("https:"):
        domain = domain
    elif domain.startswith("http:"):
        domain = domain
    else:
        domain = "http://" + domain

    rest = urllib2.splittype(domain)[1]
    host = urllib2.splithost(rest)[0]

    return host


def date2string(date):
    return "%s-%s-%s" % (date.year, date.month, date.day)

def date_latest(date):
    today = datetime.date.today()
    temp = datetime.datetime(today.year, today.month, today.day, 0, 0, 0)
    if date >= temp:
        return True
    else:
        return False

def beian_date(datestring):
    return datetime.datetime.strptime(datestring, "%Y-%m-%d %H:%M:%S")


if __name__ == '__main__':
    print date_latest(datetime.datetime.now())
